package com.zcxy360.sandtable.domain;

import com.zcxy360.sandtable.domain.CourseStudent;
import com.zcxy360.sandtable.domain.CourseStudentExample;
import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface CourseStudentMapper {
	
//
	CourseStudent selectByPrimaryKeyWithCascade(@Param("courseId") Integer courseId,@Param("userId") Integer userId);
	List<CourseStudent> list(@Param("courseStudent") CourseStudent courseStudent,@Param("key") String key,@Param("orderByClause") String orderByClause);
	List<CourseStudent> listWithCascade(@Param("courseStudent") CourseStudent courseStudent,@Param("key") String key,@Param("orderByClause") String orderByClause);
	List<Integer> selectUserIdsByCourseId(Integer courseId);
	List<CourseStudent> listByTeamId(Integer teamId);
	int insertBatch(List<CourseStudent> courseStudents);
	int deleteBatch(List<CourseStudent> courseStudents);
	String selectTeamRole(@Param("teamId")Integer teamId,@Param("userId") Integer userId);
	int countJoinedCourseByUserId(Integer userId);
	List<String> selectPhonesByCourseId(Integer courseId);
	int updateBatch(List<CourseStudent> courseStudents);
	CourseStudent selectForCompletion(@Param("courseId") Integer courseId,@Param("userId") Integer userId);
	void updateTeamCompletion(@Param("teamId") Integer teamId,@Param("isAdd") boolean isAdd);
//
	
    long countByExample(CourseStudentExample example);

    int deleteByExample(CourseStudentExample example);

    int deleteByPrimaryKey(@Param("courseId") Integer courseId, @Param("userId") Integer userId);

    int insert(CourseStudent record);

    int insertSelective(CourseStudent record);

    List<CourseStudent> selectByExample(CourseStudentExample example);

    CourseStudent selectByPrimaryKey(@Param("courseId") Integer courseId, @Param("userId") Integer userId);

    int updateByExampleSelective(@Param("record") CourseStudent record, @Param("example") CourseStudentExample example);

    int updateByExample(@Param("record") CourseStudent record, @Param("example") CourseStudentExample example);

    int updateByPrimaryKeySelective(CourseStudent record);

    int updateByPrimaryKey(CourseStudent record);
}